<?php
/*********************************************
 *  CPG Dragonfly™ CMS
 *********************************************
	Copyright © since 2010 by CPG-Nuke Dev Team
	http://dragonflycms.org

	Dragonfly is released under the terms and conditions
	of the GNU GPL version 2 or any later version
*/

namespace Poodle\Auth\Result;

class Form
{
	protected
		$fields = array(),
		$action = null,
		$submit = false,
		$css_class = null;

	public function __construct($fields, $action = null, $css_class = null, $submit=false)
	{
		if ('?'===$action[0]) {
			$action = $_SERVER['PHP_SELF'].$action;
		}
		$this->fields = $fields;
		$this->action = $action;
		$this->submit = $submit;
		$this->css_class = $css_class;
	}

	public function __get($key)
	{
		if (property_exists($this, $key)) return $this->$key;
		return null;
	}
}
